home *** CD-ROM | disk | FTP | other *** search
/ World of Education / World of Education.iso / world_s / sp12exe.zip / WORDS.DOC < prev    next >
Text File  |  1991-03-28  |  8KB  |  194 lines

  1. WORDS Version 1.2 - A fast word extractor program by Edwin Floyd.  3/28/91
  2.  
  3. There are no operational changes from previous releases.  This is
  4. as source maintenance update for TP 6.0, and for release as part
  5. of the SPELCHEK package.  See SPELCHEK.DOC.
  6.  
  7. Purpose of WORDS
  8. ----------------
  9. WORDS extracts a list of unique "words" from an input file, or
  10. several input files, and writes them to an output file, one per
  11. line. The program recognizes a number of options for:
  12.  
  13.   o Set operations on multiple files
  14.  
  15.   o Case sensitivity
  16.  
  17.   o High-order bit stripping
  18.  
  19.   o Alphabetic output sort
  20.  
  21.   o Defining the characters comprising a "word"
  22.  
  23. How to run WORDS
  24. ----------------
  25. From the DOS command line enter:
  26.  
  27.   WORDS filenames [-U/-I/-C] [-A] [-L] [-H] [-W[+/-]abc..]
  28.         [-Oname] [@name]
  29.  
  30. Spaces delimit command line parameters.  You may intermingle
  31. input text filenames and options (mark each option with a leading
  32. hyphen).  Filenames may include wild-card characters.  Some options
  33. (-W,-O) allow a character string or filename to follow the option
  34. letter.  This must follow with no intervening spaces or the program
  35. will mistake it for an input file name.  Some options (-A,-L,-H) allow
  36. a "+" or "-" to indicate "on" or "off".  This also must follow with no
  37. intervening space, and "+" is assumed if it is omitted.  You may
  38. place options and filenames in an ASCII "include" file and
  39. specify its name with a leading "@" on the command line.  An
  40. include file may contain references to other include files.  You
  41. also may specify default options, filenames and include files in
  42. the DOS environment using "SET WORDS=...".  For example:
  43.  
  44.   SET WORDS=-U -A+ -L+ -Owords.out -W-ABCDEFGHIJKLMNOPQRSTUVWXYZ
  45.   SET WORDS=@defaults.wrd -O
  46.  
  47. WORDS processes options left-to-right, first from the DOS
  48. environment, then from the command line.  Where options conflict,
  49. the last option processed prevails.  Thus, you may override "SET"
  50. environment options on the command line.
  51.  
  52. What the options mean
  53. ---------------------
  54. -U, -I or -C specifies the set operation to be performed on the
  55. extracted words from the input files.  Only one of these options
  56. is active for any given WORDS run.  The operations are:
  57.  
  58. -U       Union: Keep all unique words from any input file.
  59.          This is the default.
  60.  
  61. -I       Intersection: Keep unique words common to all input
  62.          files.
  63.  
  64. -C       Complement: Keep unique words from the second and
  65.          subsequent files, only if they are NOT contained in
  66.          the first file.
  67.  
  68. Other options:
  69.  
  70. -A[+/-]  Sort output words alphabetically (default off).  If
  71.          -A is off, output words will be in order of first
  72.          encounter in the input files.
  73.  
  74. -H[+/-]  Clear the high-order bit on each input character
  75.          (default off).  Use this option to process files
  76.          created by word processing programs, like WordStar,
  77.          that mark some letters by setting the high-order
  78.          bit, often at the beginning or end of a word.
  79.  
  80. -L[+/-]  Lower case is significant (default off).  If -L is
  81.          off, the program will shift all output words to
  82.          upper case.
  83.  
  84. -W-abc.. Replace the "word character set" with the indicated
  85.          characters.  The program checks each character in
  86.          each input file for membership in the word character
  87.          set and defines a "word" as an uninterrupted
  88.          sequence of at least one but no more than 35
  89.          characters which are members of that set.  The
  90.          default is the set of upper and lower case
  91.          alphabetic characters.
  92.  
  93. -W+abc.. Add additional characters to the word character set.
  94.  
  95. -O[name] Name the output file.  If the name is omitted ("-O "),
  96.          output goes to "StdOut" and is available for DOS a
  97.          pipe (|) or redirection (>).  StdOut is the
  98.          default.
  99.  
  100. -O-      Suppress output.  -Onul also suppresses output.  The
  101.          program will still display word counts on the
  102.          screen.
  103.  
  104. Three examples
  105. --------------
  106. 1. Generate an alphabetized list of all words appearing in the
  107. document named WORDS.DOC and write the list to file WORDS.LST.
  108. The following are equivalent:
  109.  
  110.   WORDS words.doc -U -A -Owords.lst
  111.  
  112.   WORDS words.doc -A >words.lst       (defaults: -U, StdOut)
  113.  
  114.   WORDS -U words.doc -A+ >words.lst
  115.  
  116.   SET WORDS=-A+ -Owords.lst           (set defaults)
  117.   WORDS words.doc
  118.  
  119. 2. Given a previously extracted list of words in file SPELL.CHK,
  120. generate a list of words from file LETTER.DOC which are NOT in
  121. SPELL.CHK, and write the list to LETTER.BWD.
  122.  
  123.   WORDS -C spell.chk letter.doc -Oletter.bwd
  124.  
  125. (A poor persons spelling checker?)
  126.  
  127. 3. Given file PASCAL.PRC containing a list of Pascal library
  128. procedure names, determine which procedures are referenced by
  129. Pascal source program BIGPROG.PAS and write the referenced
  130. procedure names to the screen with a pause at each screen full.
  131.  
  132.   WORDS pascal.prc bigprog.pas -I -W+_0123456789 | more
  133.  
  134. (Pascal identifiers may contain numerics or the "_" (underline)
  135. character, so we add these to the word set via "-W+_01..".)
  136.  
  137. Limitations
  138. -----------
  139. A "word" may be no longer than 35 characters.  No more than
  140. 65,535 unique words may accumulate.  All data must fit in main
  141. memory (this usually determines the limit).  Each unique word
  142. occupies its length in memory, plus an overhead of about 7 bytes,
  143. plus another 10 bytes at output time if output is alphabetized
  144. (-A+).  Thus, with a typical available memory of 500k and 5
  145. characters (average) per word, you will run out of memory after
  146. about 40,000 unique words, unsorted.
  147.  
  148. FYI, network users, WORDS opens its input files in "Read, Deny
  149. None" mode, @include files "Read, Compatibility", and the output
  150. file in "Write, Compatibility".  Only one file at a time is open,
  151. except during processing of nested @include files.
  152.  
  153. Legal Stuff
  154. -----------
  155. WORDS.EXE and WORDS.DOC and all Pascal source files are:
  156.  
  157. Copyright (c) 1990,91 by Edwin T. Floyd,
  158. All rights reserved.
  159.  
  160. WORDS is copyrighted "free" software.  The author hereby
  161. expressly permits and encourages individuals to use WORDS at home
  162. and at work and to distribute it without charge.  The author
  163. prohibits distribution of WORDS for profit, or as a part of a
  164. product sold for profit, except where explicit written permission
  165. has been obtained from the author for such distribution.  Also,
  166. users groups and shareware libraries charging a disk duplication
  167. fee not exceeding $10.00 may distribute WORDS.
  168.  
  169. The author makes no warranties of any kind, either expressed or
  170. implied, as to mercantability or fitness for any particular
  171. purpose.  WORDS.EXE and WORDS.DOC are available as is and in no
  172. event will the author be held liable for damages, including any
  173. lost profits or incidental or consequential damages, even if the
  174. author has been advised of the possibility of such damages.
  175.  
  176. Authorship
  177. ----------
  178. WORDS was written in Turbo Pascal v6.0 by:
  179.  
  180.   Edwin T. Floyd         [76067,747]  (CompuServe)
  181.   #9 Adams Park Court    404/576-3305 (work)
  182.   Columbus, GA 31909     404/322-0076 (home)
  183.  
  184. The latest version of WORDS is available on CompuServe in the
  185. IBMPRO forum, and on a number of bulletin boards around the
  186. country.
  187. - Edwin -                                                 3-28-91
  188.  
  189. Update History
  190. --------------
  191. 03-30-90 ETF V1.0 Initial public release
  192. 11-12-90 ETF V1.1 Update for TP6.0 (not released)
  193. 03-28-91 ETF V1.2 Token routines changed, public release with SPELCHEK
  194.